﻿<!DOCTYPE HTML>
<%@page import="shop.factory.DAOFactory"%>
<%@page import="shop.vo.ProductBean"%>
<html>
<head>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<meta charset="utf-8">
<link rel="stylesheet" href="../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/talk.css" />
<script src="../js/jquery-1.10.2.min.js" type="text/javascript"
	charset="utf-8"></script>
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
<title>评论商品页面</title>
</head>
<%
	String pro = (String)session.getAttribute("produ");
	ProductBean product = DAOFactory.getIProductDAOInstance().find(pro);
%>
<body>
	<nav class="navbar navbar-default" role="navigation">
		<div class="navbar-header">
			<button type="button" class="navbar-toggle" data-toggle="collapse"
				data-target="#bs-example-navbar-collapse-1">
				<span class="sr-only">Toggle navigation</span> <span
					class="icon-bar"></span> <span class="icon-bar"></span> <span
					class="icon-bar"></span>
			</button>
		</div>
		<div class="collapse navbar-collapse"
			id="bs-example-navbar-collapse-1">
			<ul class="nav navbar-nav">
				<li class="active"><a href="../index.jsp">首页</a></li>
				<li><a href="<%=request.getContextPath() %>/OrderServlet?action=MyOrder"> <img src="../images/order.png" /> 我的订单
				</a></li>
				<li></li>
				<li><a href="<%=request.getContextPath() %>/OrderServlet?action=MyCart"> <img src="../images/car.png" /> 我的购物车
				</a></li>
				<li><a href="<%=request.getContextPath() %>/FavoriteServlet?action=MyFav"> <img src="../images/favorite.png" /> 我的收藏
				</a></li>
				<li><a href="<%=request.getContextPath() %>/AddressServlet?action=MyAddress"> <img src="../images/address.png" /> 我的地址簿
				</a></li>
			</ul>

			<ul class="nav navbar-nav navbar-right">
				<li><a href="<%=request.getContextPath() %>/UserServlet?action=xinxi"><span id="huanying">欢迎光临，游客</span></a></li>
				<li><a href="../Login/login.jsp">登陆</a></li>
				<li><a href="../Login/regist.jsp">注册</a></li>
				<li><a href="<%=request.getContextPath() %>/UserServlet?action=logout" class="active" onclick="return confirm('确认退出?')">退出</a></li>
			</ul>
		</div>
	</nav>

	<div class="container" style="height: 469px;">
		<h4>
			你将要评论<a href="<%=request.getContextPath()%>/ProductServlet?action=xiangqing&proId=<%=product.getPro_id()%>"><%=product.getPro_name() %></a>
		</h4>
		<div class="page-header"></div>
		<div class="col-md-5">
			<img src="../<%=product.getPro_img()%>" />
		</div>
		<div class="col-md-7">
			<div class="coment">
				<div class="ding">
					<img src="../images/ding.png" />
				</div>
				<form action="<%=request.getContextPath() %>/CommentServlet?proId=<%=product.getPro_id() %>" name="coment" method="post">
					<div class="contentdiv">
						<textarea name="content" rows="10" cols="90" class="area"
							placeholder="你的建议是我们的动力"></textarea>
						打分：<input type="text" name="score">
					</div><br>
					<input type="submit" value="评价" class="btn btn-danger" />
					<input type="hidden" name="action" value="pingjia">
				</form>
			</div>
		</div>

	</div>
</body>
<script type="text/javascript">
<%
	String str = (String)session.getAttribute("user");
	if (session.getAttribute("user") != null) {
%>
document.getElementById("huanying").innerHTML = "欢迎光临，<%=str%>";
<%
	} else {
%>
document.getElementById("huanying").innerHTML = "欢迎光临，游客";
<%
	}
%>
</script>
</html>